export const tableInfo = {
  localize: {
    search: {
      url: "http://localhost:8080/customer/address/search"
    },
    preset: {
      status: 1,
      userId: 2
    }
  },
  filters: [
    {
      name: "customerName",
      label: "客户名称"
    }
  ],
  columns: [
    {
      width: "50",
      label: "#",
      type: "index"
    },
    {
      label: "地址编号",
      name: "addressCode"
    },
    {
      label: "客户名称",
      name: "customerName"
    },
    {
      label: "发货联系人",
      name: "contactName"
    },
    {
      label: "发货联系人电话",
      name: "contactMobile"
    },
    {
      label: "地址",
      name: "address"
    },
    {
      label: "经纬度",
      name: "district"
    },
    {
      label: "创建时间",
      name: "createAt"
    },
    {
      label: "状态",
      name: "statusName"
    },
    {
      label: "操作",
      name: "action"
    }
  ],
  actions: [
    {
      title: "新增",
      type: "add",
      target: {
        resourceId: "23"
      }
    },
    {
      title: "导入",
      type: "import",
      target: {
        resourceId: "23"
      }
    }
  ]
};
export const typeDialog = {
  title: "新增发货地址",
  entries: [
    { name: "customerName", label: "客户名称" },
    { name: "contactName", label: "联系人" },
    { name: "contactMobile", label: "联系人电话" },
    { name: "province", label: "省" },
    { name: "city", label: "市" },
    { name: "district", label: "区" },
    { name: "address", label: "详细地址" },
    { name: "addressCode", label: "地址编号" }
  ],
  actions: [
    {
      title: "保存",
      type: "submit",
      url: "http://localhost:8080/customer​/address​/shipping"
    },
    { disabled: false, title: "重置", type: "reset" },
    { disabled: false, title: "返回", type: "back" }
  ],
  localize: {
    preset: {
      userId: 1,
      type: 0
    }
  },
  rules: {
    customerName: [
      { required: true, message: "客户名称不能为空", trigger: "blur" }
    ],
    contactName: [
      { required: true, message: "联系人不能为空", trigger: "blur" }
    ],
    contactMobile: [
      { required: true, message: "联系人电话不能为空", trigger: "blur" }
    ],
    address: [{ required: true, message: "详细地址不能为空", trigger: "blur" }]
  }
};

class ViewData {
  constructor({ dirs, actions, entries }) {
    this.dirs = dirs;
    this.actions = actions;
    this.entries = entries;
  }
}

export { ViewData };
